import { defineStore } from 'pinia'
import { getCategoryAPI } from '@/api'
export const useCategoryStore = defineStore('category', {
  state: () => {
    return {
      categoryList: [] //分类数据
    }
  },
  getters: {},
  actions: {
    // 获取分类数据
    async getCategoryActions() {
      const {result} = await getCategoryAPI()
      this.categoryList = result
    }
  },
  // 开启数据缓存
  persist: { enabled: true }
})
